#!/usr/bin/env python
# -*- coding:utf-8 -*-
import io  
import sys
from urllib import request
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') #改变标准输出的默认编码  
resp = request.Request("http://www.baidu.com/")
resp.add_header("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36")
resp=request.urlopen(resp)
print (resp.read().decode("utf-8"))